﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Product.aspx.cs" Inherits="DoAnWeb.Admin.Product" %>
<%@ Register assembly="CKEditor.NET" namespace="CKEditor.NET" tagprefix="CKEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style3
        {
            font-size: x-large;
        }
        .style4
        {
            height: 56px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <br />
      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
    <table>
        <tr>
            <td colspan="2">
             
                <table class="style1" cellpadding="5px">
        <tr>
            <td class="style2" colspan="2" 
                style="text-align: center; font-size: 33px; background-color: #CCCCFF;">
                <strong>Quản lý tin khuyến mãi</strong></td>
                
        </tr>
        <tr>
        <td>
                
                </td>
                <td>
                
                </td>
        </tr>
     </table></td>
        </tr>
        
        <tr>
            <td colspan="2" align="center">
                
                
                <br />
              
             <asp:GridView ID="gvListTinKhuyenMai" runat="server" 
        BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="4" DataKeyNames="MaTinKhuyenMai" 
        style="margin-top: 0px" AllowPaging="True" 
        onpageindexchanging="gvListTinKhuyenMai_PageIndexChanging" 
        onrowcancelingedit="gvListTinKhuyenMai_RowCancelingEdit" 
        onrowcommand="gvListTinKhuyenMai_RowCommand" 
        onrowdeleting="gvListTinKhuyenMai_RowDeleting" 
        onrowediting="gvListTinKhuyenMai_RowEditing" 
        onrowupdating="gvListTinKhuyenMai_RowUpdating" 
                    onselectedindexchanged="gvListTinKhuyenMai_SelectedIndexChanged" 
                    onselectedindexchanging="gvListTinKhuyenMai_SelectedIndexChanging" 
                    PageSize="5" onrowdatabound="gvListTinKhuyenMai_RowDataBound" 
                    AutoGenerateColumns="False" >
        <Columns>
            <asp:TemplateField HeaderText="Mã tin">
                <ItemTemplate>
                    <asp:Label ID="lbMaTinKhuyenMai" runat="server" 
                        Text='<%# Bind("MaTinKhuyenMai") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tiêu đề">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("TieuDe") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtTieuDeEdit" runat="server" Text='<%# Bind("TieuDe") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvTieuDe" runat="server" 
                        ControlToValidate="txtTieuDeEdit" ErrorMessage="Nhập lại tiêu đề !" 
                        ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Giá gốc">
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" 
                        Text='<%# Bind("GiaGoc", "{0:#,#.##} VNĐ") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtGiaGocEdit" runat="server" Text='<%# Bind("GiaGoc") %>' 
                        Height="22px" Width="89px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvGiaGoc" runat="server" 
                        ControlToValidate="txtGiaGocEdit" ErrorMessage="Giá gốc không được để rỗng" 
                        ForeColor="Red" SetFocusOnError="True" Display="Dynamic">*</asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemStyle HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Phần trăm KM">
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" 
                        Text='<%# Bind("PhanTramKhuyenMai","{0:#,#.##} %") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtPhanTramKMEdit" runat="server" 
                        Text='<%# Bind("PhanTramKhuyenMai") %>' Height="20px" Width="87px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvPhanTramKMEdit" runat="server" 
                        ControlToValidate="txtPhanTramKMEdit" 
                        ErrorMessage="Phần trăm khuyến mãi không được để rỗng" ForeColor="Red" 
                        SetFocusOnError="True" Display="Dynamic">*</asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Trạng thái">
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("DaDuyet") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Width="90px" />
            </asp:TemplateField>
            <asp:ButtonField Text="Duyệt" CommandName="btnDuyet"  />
            <asp:CommandField ShowDeleteButton="True" 
                ShowEditButton="True" CancelText="Hủy" DeleteText="Xóa" 
                EditText="Chỉnh sửa" UpdateText="Cập nhật" CausesValidation="False" >
            <ItemStyle Width="120px" HorizontalAlign="Center" />
            </asp:CommandField>
            <asp:CommandField SelectText="Chi tiết" ShowSelectButton="True">
            <ItemStyle Width="70px" HorizontalAlign="Center" />
            </asp:CommandField>
        </Columns>
        <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
        <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
        <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
        <RowStyle BackColor="White" ForeColor="#003399" />
        <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
        <SortedAscendingCellStyle BackColor="#EDF6F6" />
        <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
        <SortedDescendingCellStyle BackColor="#D6DFDF" />
        <SortedDescendingHeaderStyle BackColor="#002876" />
    </asp:GridView>
            </td>
        </tr>
        
        <tr>
            <td colspan="2" class="style4">
              <strong><span class="style3">Chi tiết danh mục tiết danh mục </span></strong>
    
    <br />
            </td>
            
        </tr>
        <tr>
            <td align="right" class="style6" 
                style="padding: 5px; ">
                &nbsp;</td>
            <td align="left" style="padding: 5px">
                <asp:Label ID="lbThongBao" runat="server" Font-Bold="True" ForeColor="#0066FF"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px; ">
                Tiêu đề :</td>
            <td align="left" style="padding: 5px">
                <asp:TextBox ID="txtTieuDe" runat="server" Width="391px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvTieuDe0" runat="server" 
                    ControlToValidate="txtTieuDe" ErrorMessage="Bạn chưa nhập tiêu đề" 
                    Font-Bold="True" ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px; " 
                valign="top">
                Mô tả :</td>
            <td align="left" style="padding: 5px">
                <CKEditor:CKEditorControl ID="ckNoiDung" runat="server">
                </CKEditor:CKEditorControl>
                <asp:RequiredFieldValidator ID="rfvMoTa" runat="server" 
                    ControlToValidate="ckNoiDung" ErrorMessage="Bạn chưa nhập mô tả sản phẩm" 
                    Font-Bold="True" ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px; " 
                valign="top">
                Địa chỉ :</td>
            <td align="left" style="padding: 5px">
                <asp:TextBox ID="txtDiaChi" runat="server" Height="61px" TextMode="MultiLine" 
                    Width="363px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvDiaChi" runat="server" 
                    ControlToValidate="txtDiaChi" ErrorMessage="Bạn chưa nhập địa chỉ" 
                    Font-Bold="True" ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px; ">
                Điện thoại :
            </td>
            <td align="left" style="padding: 5px">
                <asp:TextBox ID="txtDienThoai" runat="server" Width="166px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvDienThoai" runat="server" 
                    ControlToValidate="txtDienThoai" ErrorMessage="Bạn chưa nhập điện thoại" 
                    Font-Bold="True" ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px; ">
                Gía gốc :</td>
            <td align="left" style="padding: 5px">
                <asp:TextBox ID="txtGiaGoc" runat="server" Width="166px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvGiaGoc0" runat="server" 
                    ControlToValidate="txtGiaGoc" ErrorMessage="gốc của sản phẩm" Font-Bold="True" 
                    ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px; " 
                width="20%">
                Phần trăm khuyến mãi :</td>
            <td align="left" style="padding: 5px">
                <asp:TextBox ID="txtPhanTram" runat="server" Width="166px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPhamTramKhuyenMai" runat="server" 
                    ControlToValidate="txtPhanTram" 
                    ErrorMessage="Bạn chưa nhập phần trăm khuyến mãi" Font-Bold="True" 
                    ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px; ">
                Loại sản phẩm :</td>
            <td align="left" style="padding: 5px">
                <asp:DropDownList ID="dlLoaiSanPham" runat="server" Height="33px" Width="175px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px;">
                &nbsp;</td>
            <td align="left" style="padding: 5px">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px">
                &nbsp;</td>
            <td align="left" style="padding: 5px">
                <asp:Button ID="btnCapNhat" runat="server" Height="38px" 
                    onclick="btnCapNhat_Click" Text="Cập nhật" Width="95px" />
                &nbsp;&nbsp;
                <asp:Button ID="btnXoa" runat="server" CausesValidation="False" Height="38px" 
                    onclick="btnXoa_Click" Text="Xóa" Width="92px" />
            </td>
        </tr>
        <tr>
            <td align="right" class="style6" style="padding: 5px">
                &nbsp;</td>
            <td align="left" style="padding: 5px">
                &nbsp;&nbsp;
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" Font-Bold="True" 
                    ForeColor="Red" HeaderText="Error list :" />
            </td>
        </tr>
    </table>
   
    <br />
  
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
